package com.tbvtc.agriculturalcreditchainserver2025.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 聊天消息主表（存储单聊/群聊/广播消息）
 * </p>
 *
 * @author author
 * @since 2025-11-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("chat_message")
public class ChatMessage implements Serializable {

    private static final long serialVersionUID = 1L;


    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("sender_id")
    private String senderId;

    @TableField("receiver_type")
    private Integer receiverType;

    @TableField("receiver_id")
    private String receiverId;

    @TableField("message_type")
    private String messageType;

    @TableField("content")
    private String content;

    @TableField("file_path")
    private String filePath;

    @TableField("send_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime sendTime;

    @TableField("delete_status")
    private Integer deleteStatus;

    @TableField("ext_json")
    private String extJson;
    /**
     * 语音长度
     */
    @TableField("voice_length")
    private Integer voiceLength;
    @TableField("read_status")
    private Integer readStatus;


}
